package com.travel.order.service.impl;

import java.util.List;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.travel.order.dao.OrderDao;
import com.travel.order.entity.OrderEntity;
import com.travel.order.service.OrderService;

/**
 * @classDesc: 功能描述:()
 * @author:<a href="leeue@foxmail.com">李月</a>
 * @Version:v1.0
 * @createTime:2019年3月19日 下午2:33:00
 */
@Service
@Transactional
public class OrderServiceImpl implements OrderService {

	@Autowired
	OrderDao orderDao;

	@Override
	public List<OrderEntity> findByUserId(Long userId) {
		return orderDao.findByUserId(userId);
	}

	@Override
	public List<OrderEntity> findByUserIdAndOrderStatus(Long userId, String orderStatus) {
		return orderDao.findByUserIdAndOrderStatus(userId, orderStatus);
	}

	@Override
	public OrderEntity saveOrder(OrderEntity orderEntity) {
		return orderDao.save(orderEntity);
	}

	@Override
	public void deleteOrder(OrderEntity orderEntity) {
		orderDao.delete(orderEntity);
	}

}
